package org.ncibi.cytoscape.metscape.utils;

import javax.swing.ImageIcon;

public class ImageUtils {
	
	/** Returns an ImageIcon, or null if the path was invalid. */
	public static ImageIcon createImageIcon(String path,
	                                           String description) {
	    java.net.URL imgURL = (new ImageUtils()).getClass().getResource(path);
	    if (imgURL != null) {
	        return new ImageIcon(imgURL, description);
	    } else {
	        System.err.println("Could not find the icon file: " + path);
	        return null;
	    }
	}
	
	public static ImageIcon getNcibiIcon(){
		return createImageIcon("/icons/NCIBI_logo.png", "NCIBI Logo");
	}

	public static ImageIcon getMetscapeIcon() {
		return createImageIcon("/icons/MetScape_logo.png", "MetScape Logo");
	}
}
